import 'package:retrofit/retrofit.dart';
import 'package:dio/dio.dart';

import '../../../config/bt_env_config.dart';
import '../../models/bt_app_config.dart';
import '../../models/bt_block.dart';
import '../../models/bt_broadcaster.dart';
import '../../models/bt_empty_data.dart';
import '../../models/bt_friend.dart';
import '../../models/bt_goods.dart';
import '../../models/bt_login_result.dart';
import '../../models/bt_oss_policy.dart';
import '../../models/bt_recharge.dart';
import '../../models/bt_strategy.dart';
import '../../models/bt_update_avatar_result.dart';
import '../../models/bt_user_info.dart';
import '../bt_api_result.dart';

part 'bt_dio_network_api.g.dart';

@RestApi()
abstract class BtDioNetworkApi {
  factory BtDioNetworkApi(Dio dio) = _BtDioNetworkApi;

  @GET(appConfigUrl)
  Future<BtApiResult<BtAppConfig>> getAppConfig(
      @Header('authorized') String authorized, @Queries() Map<String, dynamic> queries);

  @GET(strategyUrl)
  Future<BtApiResult<BtStrategy>> getStrategy(@Queries() Map<String, dynamic> queries);

  @GET(rongCloudTokenUrl)
  Future<BtApiResult<BtEmptyData>> getRongCloudToken(@Queries() Map<String, dynamic> queries);

  @POST(oauthUrl)
  @FormUrlEncoded()
  Future<BtApiResult<BtLoginResult>> login(
      @Header('authorized') String authorized, @Body() Map<String, dynamic> body);

  @POST(broadcasterWallUrl)
  Future<BtApiResult<List<BtBroadcaster>>> fetchBroadcasterList(@Body() Map<String, dynamic> body);

  @POST(coinGoodsUrl)
  Future<BtApiResult<List<BtGoods>>> fetchCoinGoodsList(@Body() Map<String, dynamic> body);

  @POST(logoutUrl)
  Future<BtApiResult<BtEmptyData>> logout(@Body() Map<String, dynamic> body);

  @POST(validTokenUrl)
  Future<BtApiResult<bool>> validToken(@Body() Map<String, dynamic> body);

  @POST(deleteAccountUrl)
  Future<BtApiResult<bool>> deleteAccount(@Body() Map<String, dynamic> body);

  @POST(saveUserInfoUrl)
  Future<BtApiResult<bool>> saveUserInfo(@Body() Map<String, dynamic> body);

  @GET(userInfoUrl)
  Future<BtApiResult<BtUserInfo>> getUserInfo(@Queries() Map<String, dynamic> queries);

  @POST(blockListUrl)
  Future<BtApiResult<List<BtBlock>>> getBlockList(@Body() Map<String, dynamic> body);

  @POST(friendsListUrl)
  Future<BtApiResult<List<BtFriend>>> getFriendList(@Body() Map<String, dynamic> body);

  @POST(removeBlockUrl)
  Future<BtApiResult<bool>> removeBlock(@Body() Map<String, dynamic> body);

  @GET(policyUrl)
  Future<BtApiResult<BtOssPolicy>> getOssPolicy(@Queries() Map<String, dynamic> queries);

  @POST(updateAvatarUrl)
  Future<BtApiResult<BtUpdateAvatarResult>> updateAvatar(@Body() Map<String, dynamic> body);

  @POST(createOrderUrl)
  Future<BtApiResult<BtRecharge>> recharge(@Body() Map<String, dynamic> body);

  @POST(ipaPayUrl)
  Future<BtApiResult<bool>> rechargePayment(@Body() Map<String, dynamic> body);

  @POST(addFriendUrl)
  Future<BtApiResult<bool>> addFriend(@Body() Map<String, dynamic> body);

  @POST(unfriendUrl)
  Future<BtApiResult<bool>> unfriend(@Body() Map<String, dynamic> body);

  @POST(insertRecordUrl)
  Future<BtApiResult<bool>> reportOrBlock(@Body() Map<String, dynamic> body);

  @POST(reviewModeConsumeUrl)
  Future<BtApiResult<bool>> reviewModeConsume(@Body() Map<String, dynamic> body);
}
